package dao.impl;

import com.google.common.collect.ImmutableMap;
import dao.RecruitmentTypeDao;
import domain.RecruitmentType;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by tyler on 23/6/15.
 */
@Repository
public class RecruitmentTypeDaoImpl extends BaseGenericDao<RecruitmentType, Integer> implements RecruitmentTypeDao {

    @Override
    public List<RecruitmentType> getTypeList() {
        return queryList("get-type-list", null);
    }

    @Override
    public RecruitmentType findByCode(String code) {
        Map<String, Object> params = ImmutableMap.<String, Object>builder().put("code", code).build();
        return queryOne("find-type-by-code", params);
    }
}
